package com.cherish.pattern.factory.abstractf;

import com.cherish.pattern.factory.model.Laptop;
import com.cherish.pattern.factory.model.Phone;

/**
 * @Classname TestAbstractFactory
 * @Date 2019/4/7 11:34
 * @Author admin
 * @Description TODO
 */
public class TestAbstractFactory {

    public static void main(String[] args) {
        //国产区
        ElectronicsFactory fushikang = new FuShiKangFactory();
        Phone domesticPhone = fushikang.getPhone();
        Laptop domesticLaptop = fushikang.getLaptop();

        domesticPhone.getInfo();
        domesticLaptop.getInfo();

        //进口区
        ElectronicsFactory apple = new AppleFactory();
        Phone importedPhone = apple.getPhone();
        Laptop importedLaptop = apple.getLaptop();

        importedPhone.getInfo();
        importedLaptop.getInfo();
    }

}
